package com.dylan.历史.领扣;

/**
 * @Auther: ankang
 * @Date: 2019/2/23 01:15
 * @Description:
 */
public class $0062不同路径 {

    public static void main(String[] args) {
        System.out.println(new Solution().uniquePaths(5, 7));
    }

    static class Solution {
        public int uniquePaths(int m, int n) {
            int[][] step = new int[m][n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    if (i == 0 || j == 0) {
                        step[i][j] = 1;
                    } else {
                        step[i][j] = step[i - 1][j] + step[i][j - 1];
                    }
                }
            }
            return step[m - 1][n - 1];
        }
    }
}
